<?php
include_once "../header1.php";
?>
<script type="text/javascript">
function showSchool(str)
{
var xmlhttp;    
if (str=="")
  {
  document.getElementById("List").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("List").innerHTML=xmlhttp.responseText;
    }
  }
  var sch_id=document.forms["form1"]["sch_id"].value;
  str=str+","+sch_id;
xmlhttp.open("GET","upp_edit_sch_names.php?q="+str,true);
xmlhttp.send();
}
function fills_n(val)
{
document.Upp_res.School_Id.value=val;
document.getElementById("List").innerHTML="";
}
</script>
<script type="text/javascript">
function getHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
function showHint(str)
{
var xmlhttp;    
if (str=="")
  {
  document.getElementById("List").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("List").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","upp_sch_names.php?q="+str,true);
xmlhttp.send();
}
function fill(val)
{
document.form1.SchName.value=val;
document.getElementById("List").innerHTML="";
var xmlhttp;    
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   document.getElementById("L_id").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","labids.php?q="+val,true);
xmlhttp.send();
}
</script>
<link rel="stylesheet" href="../css/datepicker.css" type="text/css" />
    <link rel="stylesheet" media="screen" type="text/css" href="../css/layout.css" />
  	<script type="text/javascript" src="../js/jquery.js"></script>
	<script type="text/javascript" src="../js/datepicker.js"></script>
    <script type="text/javascript" src="../js/eye.js"></script>
    <script type="text/javascript" src="../js/utils.js"></script>
    <script type="text/javascript" src="../js/layout.js?ver=1.0.2"></script>
</head>
<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
require_once '../index.php';
}
  else
   {
   date_default_timezone_set("Europe/Paris");
    $t_d=date("Y/m/d");
   if(isset($_POST['SaveChanges']))
   {
$Lab_Type=$_POST['Lab_Type'];
$New_Lab_Type=$_POST['New_Lab_Type'];
$Lab_Category=$_POST['Lab_Category'];
$New_Lab_Category=$_POST['New_Lab_Category'];
$Special_Projects=$_POST['Special_Projects'];
   $Lab_Type=$_POST['Lab_Type'];
   $Lab_Id=$_POST['Lab_Id'];
   $School_Id=$_POST['School_Id'];
      $Tp_Number=$_POST['Tp_Number'];
    $Account_Number=$_POST['Account_Number'];
$Date_of_commencement=$_POST['Date_of_commencement'];
	$Availability_Of_LAN=$_POST['Availability_Of_LAN'];
   $LAN_Supplier=$_POST['LAN_Supplier'];
 $Source_Of_Power=$_POST['Source_Of_Power'];
    $Supplied_Date=$_POST['Supplied_Date'];
   $Speed_Of_WAN=$_POST['Speed_Of_WAN'];
   $Wired_Date=$_POST['Wired_Date'];
   $WAN_Connection_Type=$_POST['WAN_Connection_Type'];
	$Internet_Facilities=$_POST['Internet_Facilities'];
 if($_SESSION['Access_Type']=="Teacher in Charge")
{
$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $School_Id=$row['School_Id'];
}
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
  
   if($School_Id==$Own_School_Id)
	{
  require_once 'UPP.php';
   }
   }
   }
else if($_SESSION['Access_Type']=="Administrator")
{
require_once 'UPP.php';
}   
   else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
}	$Lab_Id="";
   $School_Id="";
 
   if(isset($_POST['Edit_This']))
	   {
	$Lab_Id=$_POST['Lab_Id'];
$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $School_Id=$row['School_Id'];
}
 if($_SESSION['Access_Type']=="Teacher in Charge")
{
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
 if($Lab_Id=="Select One"||$SchName=="")
	   {
		    
	$_SESSION['errorin1']="Please select the Lab is and School id!";
} 

 if($Lab_Id!="Select One"&&$SchName!="")
	   {
		   if($School_Id==$Own_School_Id)
	{  
$result=mysql_query("SELECT * FROM lab WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
 if(mysql_num_rows($result)==0)
   {

	   $_SESSION['errornorow']="Very sorry there is no result,Please check your inputs and try again!";
   }
   }
   else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
	   }
	   }
	    else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
	   }
	   else if($_SESSION['Access_Type']=="Administrator")
{
 if($Lab_Id=="Select One"||$SchName=="")
	   {
		    
	$_SESSION['errorin1']="Please select the Lab is and School id!";
} 

 if($Lab_Id!="Select One"||$SchName!="")
	   {
		   
$result=mysql_query("SELECT * FROM lab WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
 if(mysql_num_rows($result)==0)
   {

	   $_SESSION['errornorow']="Very sorry there is no result,Please check your inputs and try again!";
   }
   }
   }
   else
	   {
	   $_SESSION['errornotallo']="Sorry you are not allowed to do this!";
	   }
   }
   ?><?php
include_once "../header2.php";
?><?php
include_once "topmenu.php";
?>
<div id="content">
	<div id="main">
	  <div id="bodyfield">
	   <div id="lefttablereg">
<form action="#" method="POST" name="form1">
  <table width="446" border="0" class="tablefontv">
    <tr>
      <th height="18" colspan="8"  scope="row" class="err"><?php
		if(isset($_POST['Edit_This'])||isset($_POST['SaveChanges']))
{
if(isset($_SESSION['errorempt']))
	{
	echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo ($_SESSION['errorempt']).'<br/>';
		unset($_SESSION['errorempt']);
	}
	if(isset($_SESSION['error']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['error'];
		unset($_SESSION['error']);
	}
	if(isset($_SESSION['errorin']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errorin'];
		unset($_SESSION['errorin']);
	}
	if(isset($_SESSION['errorin1']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errorin1'];
		
		unset($_SESSION['errorin1']);
		
	}
		if(isset($_SESSION['errornorow']))
	{echo '<img src="../images/alert.jpg" width="12" height="12"/>';
		echo $_SESSION['errornorow'];
		unset($_SESSION['errornorow']);
		
	}
	if(isset($_SESSION['errornotallo']))
{
echo '<img src="../images/alert.jpg" width="12" height="12"/>';
echo $_SESSION['errornotallo'];
unset($_SESSION['errornotallo']);
}
}
		?>
        </th>
        </tr>
    <tr>
      <th width="86" rowspan="2"  scope="row" bgcolor="#6AB5FF">&nbsp;</th>
      <td width="102" height="26" bgcolor="#6AB5FF"  scope="row">School's Name</td>
		<td width="9" align="left" scope="row" bgcolor="#6AB5FF">:-</td>
      <td width="231" colspan="2" bgcolor="#999999">
      <?php
	  $hin=$_SESSION['NIC_Number'].",".$_SESSION['Access_Type'];
		   echo "<input type='hidden' size='1' id='sch_id' name='sch_id' value='$hin'/>";
	  
	 	if($_SESSION['Access_Type']=="Teacher in Charge")
{
	$NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id']; 
    $snam=mysql_query("SELECT * FROM school WHERE School_Id='$Own_School_Id'");
	  if($ros=mysql_fetch_array($snam))
	  {
	  $SchName=$ros['Name'].','.$ros['Address'];
	  }
}
	 echo "<input type='text' id='SchName' name='SchName' onKeyUp='showHint(this.value)' value='$SchName' size='40' readonly='readonly'/>";
}
	else if($_SESSION['Access_Type']=="Administrator")
{
	if(!isset($SchName))
	{
		$snam=mysql_query("SELECT * FROM school WHERE School_Id='$School_Id1'");
	  if($ros=mysql_fetch_array($snam))
	  {
	  $SchName=$ros['Name'].','.$ros['Address'];
	  }
	}
	    echo "<input type='text' id='SchName' name='SchName' onKeyUp='showHint(this.value)' value='$SchName' size='40'/>";
}
	  ?></td>
    </tr>
    <tr>
      <td height="28" bgcolor="#6AB5FF" scope="row">Lab Id</td>
      <td align="left" scope="row" bgcolor="#6AB5FF">:-</td>
      <td colspan="2" bgcolor="#999999"><div id="L_id"><select name="Lab_Id" id="select">
        <?php
	   if(isset($_POST['SaveChanges']))
	  {
	  $La_Id=$_SESSION['La_Id'];
	    echo '<option value="'.$La_Id.'">'.$La_Id.'</option>';
		 unset($_SESSION['La_Id']);
	  }
	  if(isset($_POST['Edit_This']))
	  {
	echo '<option value="'.$Lab_Id.'">'.$Lab_Id.'</option>';
	  }
	  else
	  {
		  echo '<option value="Select One">Select One</option>';
	  }
	  ?>
        <?php
	 $Schoo_Id=$_POST['School_Id'];
	   if($Schoo_Id!="Select One")
	  {
	  $lab=mysql_query("SELECT DISTINCT(Lab_Id) FROM lab WHERE School_Id='$Schoo_Id'");
	  }
	  if($Schoo_Id=="Select One"&&$Schoo_Id=="")
	  {
	  $lab=mysql_query("SELECT DISTINCT(Lab_Id) FROM lab");
	  }
  while($row=mysql_fetch_array($lab))
  {
	 $L_Id=$row['Lab_Id'];

	  echo '<option value="'.$L_Id.'">'.$L_Id.'</option>';
  }
	  ?>
      </select></div></td>
      </tr>
    <tr>
      <th colspan="2" bgcolor="#6AB5FF" scope="row"><a href="UpdateLab.php" class="reset">Reset |</a>
        <input name="Edit_This" align="middle" type="submit" value="Edit this" class="buttonok"/></th>
      <th colspan="4" bgcolor="#6AB5FF" scope="row"></th>
      </tr>
    
  </table>
  <br/>
  <br/>  
</form>
<form action="#" method="POST" name="Upp_res">
    <?php 
if(isset($_POST['Edit_This']))
		{ 
	$Lab_Id=$_POST['Lab_Id'];
$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $School_Id=$row['School_Id'];
}
     $_SESSION['Lab_Id']=$Lab_Id;
$_SESSION['School_Id']=$School_Id;

	   if($Lab_Id!="Select One"&&$SchName!="")
	   {
     if($_SESSION['Access_Type']=="Teacher in Charge")
{
$SchName=$_POST['SchName'];
$name=explode(",",$SchName);
$nam=$name[0];
$tn=count($name);
for($i=1;$i<$tn;$i++)
{
if(empty($adr))
{
$adr=$name[$i];
}
else
{
$adr=$adr.",".$name[$i];
}
}
$results= mysql_query("SELECT * FROM school Where Name='$nam' AND Address='$adr'");
if($row = mysql_fetch_array($results))
{
 $School_Id=$row['School_Id'];
}
   $NIC_Number=$_SESSION['NIC_Number'];
   $get_Sch=mysql_query("SELECT * FROM teacher WHERE T_NIC_Number='$NIC_Number'");
   if($rowsch=mysql_fetch_array($get_Sch))
{
   $Own_School_Id=$rowsch['School_Id'];
  
   if($School_Id==$Own_School_Id)
	{
	$result=mysql_query("SELECT * FROM lab WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
   $resultnet=mysql_query("SELECT * FROM network WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
   }
   }
   }
   else if($_SESSION['Access_Type']=="Administrator")
{
   $result=mysql_query("SELECT * FROM lab WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
   $resultnet=mysql_query("SELECT * FROM network WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
   }
  if(mysql_num_rows($result)>0)
  {
 echo '<table width="458" border="0" class="tablefontv">';
	while($row=mysql_fetch_array($result))
  {
  if($rownet=mysql_fetch_array($resultnet))
{
	$Availability_Of_LAN=$rownet['Availability_Of_LAN'];
    $LAN_Supplier=$rownet['LAN_Supplier'];
    $Supplied_Date=$rownet['Supplied_Date'];
    $Speed_Of_WAN=$rownet['Speed_Of_WAN'];
    $WAN_Connection_Type=$rownet['WAN_Connection_Type'];
	$Wired_Date=$rownet['Wired_Date'];
	$Internet_Facilities=$rownet['Internet_Facilities'];
	if(($Internet_Facilities!="Yes"&&$Internet_Facilities!="No")||$Internet_Facilities=="")
		{
		$Internet_Facilities=="No";
		}
		if(($Availability_Of_LAN!="Yes"&&$Availability_Of_LAN!="No")||$Availability_Of_LAN=="")
		{
		$Availability_Of_LAN=="No";
		}
	}
	
$Lab_Type=$_POST['Lab_Type'];
	$Lab_Category=$row['Lab_Category'];
   $S_Pro=$row['Special_Project'];
	$Lab_Type=$row['Lab_Type'];
   $Lab_Id=$row['Lab_Id'];
   $School_Id=$row['School_Id'];
 $Source_Of_Power=$row['Source_Of_Power'];
    $Tp_Number=$row['Tp_Number'];
    $Account_Number=$row['Account_Number'];
    $Date_of_commencement=$row['Date_of_commencement'];   
	 echo '<tr>';
        echo '<th width="200" height="25" scope="row">';
		echo "Lab Id:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Lab_Id1' value='$Lab_Id'/>";		
		echo '</td>';
      echo '</tr>';
	   echo '<tr>';
        echo '<th width="200" height="25" scope="row">';
		echo "Lab Type:";
		echo '</th>';
        echo '<td width="144"><select name="Lab_Type" id="Lab_Type">';	    
	  if(isset($Lab_Type))
	  {
	 echo '<option value="'.$Lab_Type.'">'.$Lab_Type.'</option>';
	  }
	  else
	  {
	  echo '<option value="Select One">Select One</option>';
	  }
	  $lab=mysql_query("SELECT DISTINCT(Lab_Type) FROM lab");	  
  while($row=mysql_fetch_array($lab))
  {  
  $L_Type=$row['Lab_Type'];  	  
if($L_Type!=$Lab_Type)
{
	echo '<option value="'.$L_Type.'">'.$L_Type.'</option>';
}
}
   ?>
      </select><br/><label><font color="red">or</font> New lab type:</label>&nbsp;&nbsp;&nbsp;
	  <?php
	  if($New_Lab_Type!="")
	  {
	  echo "<input type='text' name='New_Lab_Type' value='$New_Lab_Type'/>";
	  }
	  else
	  {
	  echo "<input type='text' name='New_Lab_Type'/>";
	  }
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Lab Category:";
		echo '</th>';
        echo '<td><select name="Lab_Category" id="Lab_Category">';
	  if(isset($Lab_Category))
	  {
	 echo '<option value="'.$Lab_Category.'">'.$Lab_Category.'</option>';
	  }
	  else
	  {
	  echo '<option value="Select One">Select One</option>';
	  }
	  $lab=mysql_query("SELECT DISTINCT(Lab_Category) FROM lab");	  
  while($row=mysql_fetch_array($lab))
  {  
  $L_Category=$row['Lab_Category'];  	  
if($L_Category!=$Lab_Category)
{
	echo '<option value="'.$L_Category.'">'.$L_Category.'</option>';
}
}
   ?>
      </select><br/><label><font color="red">or</font> New lab category:</label>&nbsp;&nbsp;&nbsp;
	  <?php
	  if($New_Lab_Category!="")
	  {
	  echo "<input type='text' name='New_Lab_Category' value='$New_Lab_Category'/>";
	  }
	  else
	  {
	  echo "<input type='text' name='New_Lab_Category'/>";
	  }		
		echo '</td>';
      echo '</tr>';	
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "School:";
		echo '</th>';
        echo '<td>';
		$sch_name=mysql_query("SELECT * FROM school WHERE School_Id='$School_Id'");
		if($row_sn=mysql_fetch_array($sch_name))
		{
		$School_Name=$row_sn['Name'];
		}
		echo "<input type='text' name='School_Id' value='$School_Name' onKeyUp='showSchool(this.value)' size='35'/>";		
		echo '</td>';
      echo '</tr>';
       echo '<tr>';
        echo '<th width="200" height="25" scope="row">';
		echo "Special Projects:";
		echo '</th>';
        echo '<td width="144">';
$All_Special_Projects=="";
$OLPC="";
$Multimice="";
$IWB="";
$all_S_P=mysql_query("SELECT DISTINCT(Special_Project) FROM lab");
while($r_sp=mysql_fetch_array($all_S_P))
{
$sp_exists="";
$each_sp=explode(",",$r_sp['Special_Projects']);
$All_SProjects=explode(",",$All_Special_Projects);
for($spr=0;$spr<count($each_sp);$spr++)
{
if($each_sp[$spr]!="")
{
if(substr($each_sp[$spr],0,6)=="other_")
{
$each_sp[$spr]=substr($each_sp[$spr],6);
}
if($each_sp[$spr]=="OLPC")
{
$OLPC="exists";
}
else if($each_sp[$spr]=="Multimice")
{
$Multimice="exists";
}
else if($each_sp[$spr]=="IWB")
{
$IWB="exists";
}

for($s=0;$s<count($All_SProjects);$s++)
{
if($each_sp[$spr]==$All_SProjects[$s])
{
$sp_exists="yes";
break;
}
}
if($sp_exists!="yes")
{
if(empty($All_Special_Projects))
{
$All_Special_Projects=$each_sp[$spr];
}
else
{
$All_Special_Projects=$All_Special_Projects.",".$each_sp[$spr];
}
}
}
}
}
if($OLPC!="exists")
{
if(empty($All_Special_Projects))
{
$All_Special_Projects="OLPC";
}
else
{
$All_Special_Projects=$All_Special_Projects.",OLPC";
}
  }
  if($Multimice!="exists")
{
if(empty($All_Special_Projects))
{
$All_Special_Projects="Multimice";
}
else
{
$All_Special_Projects=$All_Special_Projects.",Multimice";
}
   }
   if($IWB!="exists")
{
if(empty($All_Special_Projects))
{
$All_Special_Projects="IWB";
}
else
{
$All_Special_Projects=$All_Special_Projects.",IWB";
}
   }
    
$All_Spe_Projects=explode(",",$All_Special_Projects);
  $other="";
echo '<div style="width:180px; height:150px; overflow-Y:scroll; ">';
if($S_Pro!="")
{
$S_Proje= explode(",",$S_Pro);
for($s=0;$s<count($All_Spe_Projects);$s++)
{
$S_Proj="";
for($i=0;$i<count($S_Proje);$i++)
{
if($S_Proje[$i]==$All_Spe_Projects[$s])
{
$S_Proj="yes";
}
}
if($S_Proj=="yes")
{
echo "<input type='checkbox' name='Special_Projects[]' value='$All_Spe_Projects[$s]' checked='checked'/>";
  echo $All_Spe_Projects[$s];
    echo '<br/>';
  }
  else if($S_Proj=="")
  {
echo "<input type='checkbox' name='Special_Projects[]' value='$All_Spe_Projects[$s]'/>";
  echo $All_Spe_Projects[$s];
    echo '<br/>';
  }
else if(substr($All_Spe_Projects[$s],0,6)=="other_")
  {
  $other="exists";
    $sp=substr($All_Spe_Projects[$s],6);	
	if($sp!="")
	{
echo "<input type='checkbox' name='Special_Projects[]' value='Others(P1.specify)' checked='checked'/>";
echo "Others";
  echo '<br/>';
  }
  else
  {
echo "<input type='checkbox' name='Special_Projects[]' value='Others(P1.specify)'/>";
echo "Others";
  echo '<br/>';
  }
?>
<textarea name='Special_Projects_Others'><?php echo $sp." "; ?></textarea>
<?php
}
}
if($other!="exists")
{
echo "<input type='checkbox' name='Special_Projects[]' value='Others(P1.specify)'/>";
echo "Others";
  echo '<br/>';
 ?>
<textarea name='Special_Projects_Others'></textarea>
<?php
}
}
else
{
for($sp=0;$sp<count($All_Spe_Projects);$sp++)
{
echo "<input type='checkbox' name='Special_Projects[]' value='$All_Spe_Projects[$sp]'/>";
echo "$All_Spe_Projects[$sp]";
echo '<br/>';
}
echo "<input type='checkbox' name='Special_Projects[]' value='Others(P1.specify)'/>";
echo "Others:";
  echo '<br/>';
echo "<textarea name='Special_Projects_Others'></textarea>";
}		
		echo '</td>';
      echo '</tr>';	
       echo '<tr>';
        echo '<th width="200" height="25" scope="row">';
		echo "Source Of Power:";
		echo '</th>';
        echo '<td width="144">';
		echo "<input type='text' name='Source_Of_Power' value='$Source_Of_Power'/>";		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Telephone Number:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Tp_Number' value='$Tp_Number'/>";
		
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "
		Account Number:";
		echo '</th>';
        echo '<td>';
		echo "<input type='text' name='Account_Number' value='$Account_Number'/>";
	
		echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Date of commencement:";
		echo '</th>';
       echo '<td>';
	   echo "<input type='text' name='Date_of_commencement' value='$Date_of_commencement' class='inputDate' id='inputDate'/>";

	   echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Availability of LAN:"; 
		echo '</th>';
        echo '<td>';
		
		if($Availability_Of_LAN=="Yes"||$Availability_Of_LAN=="No")
		{
		if($Availability_Of_LAN=="Yes")
		{
		echo '<input type="radio" name="Availability_Of_LAN" value="Yes" id="Availability_Of_LAN_0" checked="checked" />';
       echo "Yes";
	   echo '<input type="radio" name="Availability_Of_LAN" id="Availability_Of_LAN_1" value="No"/>';
       echo "No";
	   }
	   if($Availability_Of_LAN=="No")
	   {
	   
	   echo '<input type="radio" name="Availability_Of_LAN" id="Availability_Of_LAN_0" value="Yes"/>';
       echo "Yes";
	    echo '<input type="radio" name="Availability_Of_LAN" value="No" id="Availability_Of_LAN_1" checked="checked" />';
       echo "No";
	   }
		}
		else
		{
		echo '<input type="radio" name="Availability_Of_LAN" id="Availability_Of_LAN_0" value="Yes"/>';
       echo "Yes";
	    echo '<input type="radio" name="Availability_Of_LAN" id="Availability_Of_LAN_1" value="No"/>';
       echo "No";
		}
        echo '</td>';
      echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "LAN Supplier:"; 
		echo '</th>';
        echo '<td>';
		if(isset($LAN_Supplier))
		{
		echo "<input type='text' name='LAN_Supplier' value='$LAN_Supplier'/>";
		}
		else
		{
		echo "<input type='text' name='LAN_Supplier'/>";
		}
		echo '</td>';
      echo '</tr>';
	  echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Supplied Date:"; 
		echo '</th>';
        echo '<td>';
		if(isset($Supplied_Date))
		{
		echo "<input type='text' name='Supplied_Date' value='$Supplied_Date' class='inputDate1' id='inputDate1'/>";
		}
		else
		{
		echo "<input type='text' name='Supplied_Date' class='inputDate1' id='inputDate1' value='$t_d'/>";
		}
		echo '</td>';
      echo '</tr>';
	 
 echo '</tr>';
      echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Speed Of WAN:"; 
		echo '</th>';
        echo '<td>';
		if(isset($Speed_Of_WAN))
		{
		echo "<input type='text' name='Speed_Of_WAN' value='$Speed_Of_WAN'/>";
		}
		else
		{
		echo "<input type='text' name='Speed_Of_WAN'/>";
		}
		echo '</td>';
      echo '</tr>';
	  echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "WAN Connection Type:"; 
		echo '</th>';
        echo '<td>';
		if(isset($WAN_Connection_Type))
		{
		echo "<input type='text' name='WAN_Connection_Type' value='$WAN_Connection_Type'/>";
		}
		else
		{
		echo "<input type='text' name='WAN_Connection_Type'/>";
		}
		
		echo '</td>';
      echo '</tr>';
	  
	  echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Wired Date:"; 
		echo '</th>';
        echo '<td>';
		if(isset($Wired_Date))
		{
		echo "<input type='text' name='Wired_Date' value='$Wired_Date' class='inputDate2' id='inputDate2'/>";
		}
		else
		{
		echo "<input type='text' name='Wired_Date' class='inputDate2' id='inputDate2' value='$t_d'/>";
		}
		echo '</td>';
      echo '</tr>';
	   echo '<tr>';
        echo '<th height="25" scope="row">';
		echo "Internet Facilities:"; 
		echo '</th>';
        echo '<td>';
		if($Internet_Facilities=="Yes"||$Internet_Facilities=="No")
		{
		if($Internet_Facilities=="Yes")
		{
		echo '<input type="radio" name="Internet_Facilities" value="Yes" id="Internet_Facilities_0" checked="checked" />';
       echo "Yes";
	   echo '<input type="radio" name="Internet_Facilities" value="No" id="Internet_Facilities_1" />';
       echo "No";
	   }
	   if($Internet_Facilities=="No")
	   {
	   
	   echo '<input type="radio" name="Internet_Facilities" value="Yes" id="Internet_Facilities_0"/>';
       echo "Yes";
	    echo '<input type="radio" name="Internet_Facilities" value="No" id="Internet_Facilities_1" checked="checked" />';
       echo "No";
	   }
		}
		else
		{
		echo '<input type="radio" name="Availability_Of_LAN" value="Yes" id="Internet_Facilities_0"/>';
       echo "Yes";
	    echo '<input type="radio" name="Availability_Of_LAN" value="No" id="Internet_Facilities_1"/>';
       echo "No";
		}
		echo '</td>';
      echo '</tr>';
	 
  }
    echo '</table>';
	
   echo "<br/>";
   echo '<input name="SaveChanges" align="middle" type="submit" value="Save changes" class="regbutton"/>';
 }
 }
 } 
	   ?>
       </form>
   </div>
 <div id="righttablereg">
  <div class="suggestionListsch" id="List"></div>
 </div>
</div>
</div>
</div>
<div id="sidebar">
<br/>
<div id="partners" class="boxed">
			<h2 class="title">LABS</h2>
            </div> 
<?php
include_once "menu.php";
?>
 <?php
include_once "../footer.php";
?>
<?php

}
?>
</body>
</html>